package com.kantboot.business.ac.controller;

import com.kantboot.business.ac.domain.entity.BusAcRechargeProductOrder;
import com.kantboot.business.ac.domain.vo.BusAcRechargeProductPhoneTypeVO;
import com.kantboot.business.ac.domain.vo.BusAcRechargeProductTypeVO;
import com.kantboot.business.ac.service.IBusAcRechargeProductService;
import com.kantboot.util.common.result.RestResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/business-ac-web/rechargeProduct")
public class BusAcRechargeProductController {

    @Resource
    private IBusAcRechargeProductService service;

    /**
     * 获取所有
     */
    @RequestMapping("/getAll")
    public RestResult<List<BusAcRechargeProductTypeVO>> getAll() {
        return RestResult.success(service.getAll(),"getSuccess","获取成功");
    }

    /**
     * 获取所有手机充值产品
     */
    @RequestMapping("/getAllPhone")
    public RestResult<List<BusAcRechargeProductPhoneTypeVO>> getAllPhone() {
        return RestResult.success(service.getAllPhone(),"getSuccess","获取成功");
    }

    /**
     * 生成订单号
     */
    @RequestMapping("/generatePayOrder")
    public RestResult generatePayOrder(@RequestBody BusAcRechargeProductOrder order) {
        return RestResult.success(service.generatePayOrder(order),"getSuccess","获取成功");
    }


}